package router

import (
	"github.com/gin-gonic/gin"
	"gowww/comeon/controllers"
)

func Router() {
	r := gin.Default()
	r.GET("/ping", func(c *gin.Context) {
		//输出json结果给调用方
		c.JSON(200, gin.H{
			"message": "pong",
		})
	})
	// 登陆
	r.POST("/login", controllers.Login)
	r.POST("/menu/list", controllers.MenuList)
	r.POST("/menu/add", controllers.MenuAdd)

	r.POST("/taobao/passwd", controllers.TaobaoPasswd)
	r.POST("/taobao/order", controllers.GetOrderByTaobao)
	r.Run(":9090") // listen and serve on 0.0.0.0:8080
}
